import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: '/',
    name: 'homePage',
    component: () => import('../views/HomePage.vue')
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import('../views/BlogDetail.vue')
  },
  {
    path: "/dashboard",
    component: () => import("../views/dashboard/Dashboard.vue"),
    children: [
      {
        path: '/dashboard/category',
        name: 'Category',
        component: () => import('../views/dashboard/Category.vue')
      },
      {
        path: '/dashboard/article',
        name: 'Article',
        component: () => import('../views/dashboard/Article.vue')
      },
    ]
  },
  {
    path: "/login",
    component: () => import("../views/Login.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
